import React, { useEffect, useState } from 'react'
import { Table, Button, Space } from 'antd';
import axios from 'axios';
export default function IdentityData() {
  const [dataSource, setDataSource] = useState([])
  const columns = [
    {
      title: '序号',
      dataIndex: 'index',
      key: 'index',
      align: "center",
      width: "5%",
      render: (text, record, index) => {
        return <span style={{ fontSize: "12px" }}>{index + 1}</span>
      }
    },
    {
      title: '产品名称',
      dataIndex: 'ProductName',
      key: 'productname',
      align: "center",
      render: (text) => {
        return <span style={{ fontSize: "12px" }}>{text}</span>
      }
    },
    {
      title: '赋码类型',
      dataIndex: 'EncodeType',
      key: 'encodetype',
      align: "center",
      render: (text) => {
        return <span style={{ fontSize: "12px" }}>{text}</span>
      }
    },
    {
      title: '标识',
      dataIndex: 'Code',
      key: 'code',
      align: "center",
      render: (text) => {
        return <span style={{ fontSize: "12px" }}>{text}</span>
      }
    },
    {
      title: '赋码方式',
      dataIndex: 'EncodeMode',
      key: 'encodemode',
      align: "center",
      render: (text) => {
        return <span style={{ fontSize: "12px" }}>{text}</span>
      }
    },
    {
      title: '设备名称',
      dataIndex: 'DeviceName',
      key: 'devicename',
      align: "center",
      render: (text) => {
        return <span style={{ fontSize: "12px" }}>{text}</span>
      }
    },
    {
      title: '打印机位置',
      dataIndex: 'DevicePlacementPosition',
      key: 'deviceplacementposition',
      align: "center",
      render: (text) => {
        return <span style={{ fontSize: "12px" }}>{text}</span>
      }
    },
    {
      title: '赋码时间',
      dataIndex: 'AscribeCodeTime',
      key: 'ascribecodetime',
      align: "center",
      render: (text) => {
        return <span style={{ fontSize: "12px" }}>{text}</span>
      }
    },
    {
      title: '上传码批次ID',
      dataIndex: 'UploadCodeId',
      key: 'uploadcodeid',
      align: "center",
      render: (text) => {
        return <span style={{ fontSize: "12px" }}>{text}</span>
      }
    }
  ];
  useEffect(() => {
    axios.get("/identify/selectall").then(res => {
      setDataSource(res.data)
    })

  }, [])
  return (

    <div>

      <div style={{ textAlign: "right" }}>
        {/* <Button style={{ color: "white", fontSize: "12px", borderRadius: "4px", margin: "0 0 0 10px", background: "#4e9dfd" }} >配置</Button> */}
      </div>
      <Table
        columns={columns} dataSource={dataSource} style={{ margin: "5px 0 0 0" }}
        rowKey={item => item.id}
        pagination={{}}
        size='small'
        scroll={{ x: 1200 }}
      >
      </Table>

    </div >

  )
}
